<?php

	class ListingClaim extends AppModel
	{
		var $name = "ListingClaim";
		
		var $belongsTo = array("Listing");
		
		const STATUS_PENDING  = 0;
		const STATUS_ASSIGNED = 1;
		const STATUS_REJECTED = 2;
		function initialize()
		{
			$this->fieldProperties = array(
				'name' => array('label'=>__("Your name"),'type'=>"text",'validate'=>VALID_NOT_EMPTY,'group'=>array("claim",'index')),
				'email' => array("label"=>__("Your Email"),'type'=>"text",'validate'=>array("rule"=>"email",'required'=>1,'message'=>__("Please enter a valid E-mail address")),'group'=>array("claim",'index')),
				'phone_number'=> array("label"=>__("Phone number"),'type'=>"text",'validate'=>VALID_NOT_EMPTY,'group'=>array("claim",'index')),
				'explanation' => array('label' => __("Claim explanation"),'type'=>"textarea",'validate'=>VALID_NOT_EMPTY,'group'=>array("claim",'index')),
				'status' => array("label"=>__("Status"),'type'=>"select",'options'=>
				array(self::STATUS_PENDING => __("Pending"),self::STATUS_ASSIGNED => __("Assigned"),self::STATUS_REJECTED => __("Rejected")),"group"=>array("search")),
				'check' => array('type'=>'checkbox','label'=>__("I warrant that I am an authorized representative of this listing."),'group'=>array("claim"),'validate'=>array("rule"=>VALID_NOT_EMPTY,'message'=>__("You need to be a authorized representative of this listing."),'required'=>1),'group'=>array("claim")),
				'user' => array('label'=>__("User"),'group'=>'index'),
				'listing_id' => array("group"=>array("search"),'type'=>"text",'label'=>__("Listing"))
			);
			parent::initialize();
		}
	}
?>